package single;

/**
 * @author GongXincheng
 * @since 2019-08-02 18:49
 */
public class Demo1 {

    private static Demo1 instance = new Demo1();

    private Demo1() {}

    public static Demo1 getInstance() {
        return instance;
    }

    public static void main(String[] args) {
        Demo1 instance1 = Demo1.getInstance();
        Demo1 instance2 = Demo1.getInstance();
        System.out.println(instance1 == instance2);
    }

}
